Write a custom CUDA kernel to optimize the GCU (Growing Cosine Unit) activation function using double precision (float64).

The mathematical definition is:
f(x) = x * cos(x)

Problem Analysis:
1. Precision: Previous float32 implementations showed discrepancies with PyTorch's reference implementation. To match accuracy requirements, we use float64 (double).
2. Memory Bandwidth: This is a memory-bound element-wise operation. Optimizing memory access patterns is crucial.

Optimization Strategy: Vectorized Double-Precision Kernel

1. Data Type: Use `double` for all computations to ensure high precision.

2. Vectorized Memory Access (128-bit): Since a double is 8 bytes, a 128-bit transaction corresponds to 2 doubles. We define a `Double2` struct to load/store 2 elements per instruction. This maintains optimal bus utilization.

3. Fused Computation: Compute `x * cos(x)` in registers using double precision arithmetic.

4. Grid-Stride Loop: Handle arbitrary input sizes efficiently.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

BATCH_SIZE = 4096
DIM = 4096
SHAPE = (BATCH_SIZE, DIM)

DTYPE = torch.float64

class GCU(nn.Module):
    """
    GCU Activation Function.
    https://arxiv.org/pdf/2108.12943
    Formula: f(x) = x * cos(x)
    """
    def __init__(self):
        super(GCU, self).__init__()

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x * torch.cos(x)

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.act = GCU()
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.act(x)

def get_inputs():
    x = torch.randn(SHAPE, dtype=DTYPE)
    return [x.contiguous()]

def get_init_inputs():
    return []